// 导入路由组件
import {
  Router,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom'

// 导入页面组件
import Login from './pages/Login'
import Layout from './pages/Layout'
import NotFound from './pages/NotFound'
import { AuthRoute } from './components/AuthRoute'
import { customHistory } from '@/utils'

import './App.scss'
function App() {
  return (
    <Router history={customHistory}>
      <div className='app'>
        <Switch>
          <Route path='/' exact render={() => <Redirect to='/home' />} />
          <AuthRoute path='/home' component={Layout}></AuthRoute>
          <Route path='/login' component={Login}></Route>
          <Route>
            <NotFound />
          </Route>
        </Switch>
      </div>
    </Router>
  )
}
export default App
